/**
 * Created by kangdaye on 16/6/5.
 */
app.controller('withdrawListCtr',["$scope","$rootScope","ngDialog","withdrawListCache", function($scope,$rootScope,ngDialog,withdrawListCache) {
    $scope.tab = withdrawListCache.listTab;
    $scope.getData = {
        status : undefined
    };
    $scope.gridOptions = {
        url          : servicePath + 'withdraw/list',
        columnDefs   : withdrawListCache.listTableHeader,
        params       : $scope.getData
    };

    $scope.tabClick = function(id){
        $scope.getData.status = id;
        $scope.gridOptions.refresh();
    };


    $scope.audit = function(uid,id){
        ngDialog.open({
            template: '/admin/view/withdraw/withdrawList/withdrawListAuditDialog.html',
            width: 650,
            controller: 'withdrawListAuditDialogCtr',
            resolve: {
                getData: function() {
                    return {
                        uid : uid,
                        id : id
                    };
                }
            }
        });
    };

    $scope.detail = function(uid,auditlog){
        ngDialog.open({
            template: '/admin/view/withdraw/withdrawList/withdrawListDetailDialog.html',
            width: 650,
            controller: 'withdrawListDetailDialogCtr',
            resolve: {
                getData: function() {
                    return {
                        id : uid
                    };
                },
                viewData: function(){
                    return {
                        auditlog : auditlog
                    }
                }
            }
        });
    };

}]);
